package com.gx.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;

/**
 * 时间转corn
 *
 * @author Promsing(张有博)
 * @version 1.0.0
 * @since 2022/3/30 - 15:09
 */
public class TimeUtil {

    private static final SimpleDateFormat SDF = new SimpleDateFormat("ss mm HH dd MM ? yyyy");
    /***
     *  功能描述：日期转换cron表达式
     */
    public static String formatDateByPattern(Date date) {
        String formatTimeStr = null;
        if (Objects.nonNull(date)) {
            formatTimeStr = SDF.format(date);
        }
        return formatTimeStr;
    }
}